{% extends '::base.html.twig' %}

{% block title %}{% trans %}Login{% endtrans %}{% endblock %}

{% block body %}
<div class="row-fluid whiteWrapper">
    <form class="form-horizontal login" action="{{ path('login_check') }}" method="post">
        {% for flashMessage in app.session.flashbag.get('loginNeed') %}
        <div class="alert-info alert">
            <button type="button" class="close" data-dismiss="alert">&times;</button>
            {% trans %}You need to login to complete this process{% endtrans %}
        </div>
        {% endfor %}
        
        {% for flashMessage in app.session.flashbag.get('activationNeed') %}
        <div class="alert-info alert">
            <button type="button" class="close" data-dismiss="alert">&times;</button>
            {% trans %}Your account is not active, please check your email for your activation link{% endtrans %}
        </div>
        {% endfor %}

        {% for flashMessage in app.session.flashbag.get('userEdited') %}
        <div class="alert-info alert">
            <button type="button" class="close" data-dismiss="alert">&times;</button>
            {% trans %}Edited Successfully{% endtrans %}.
        </div>
        {% endfor %}

        {% if error %}
        <div class="alert-error alert">
            <button type="button" class="close" data-dismiss="alert">&times;</button>
            {{ error.message | trans }}
        </div>
        {% endif %}

        <fieldset>
            <legend>{% trans %}Login{% endtrans %}</legend>
            <hr class="smallHr">
            <div class="control-group">
                <label class="control-label">{% trans %}Username / Email{% endtrans %}</label>
                <div class="controls">
                    <input class="input-xlarge" value="{{ last_username }}" name="_username" type="text" placeholder="{% trans %}Username{% endtrans %}" />
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">{% trans %}Password{% endtrans %}</label>
                <div class="controls">
                    <input class="input-xlarge" name="_password" type="password" placeholder="{% trans %}Password{% endtrans %}" />
                </div>
            </div>
            <div class="control-group">
                <div class="controls">
                    <label class="checkbox">
                        <input type="checkbox" name="_remember_me" checked="" />{% trans %}Remember me{% endtrans %}
                    </label>
                    <a href="{{ path('user_signup') }}">{% trans %}Create Account{% endtrans %}</a>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">&nbsp;</label>
                <div class="controls">
                    <button class="btn blue submit loginBtn" type="submit">{% trans %}Login{% endtrans %}</button>
                </div>
            </div>
        </fieldset>
    </form>
</div>
{% endblock %}
